package com.veryUsedCar.api;

import com.veryUsedCar.api.fallback.UserServiceApiFallback;
import com.veryUsedCar.data.Result;
import com.veryUsedCar.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "springcloud-veryUsedCar-user-service", fallback = UserServiceApiFallback.class)
public interface UserServiceApi {

    //跟被调用的controller保持一致
    @GetMapping("/user/v1{userId}")
    Result<UserDTO> findUserById(@PathVariable Long userId);

    @GetMapping("/user/v1/findUserByName")
    Result<UserDTO> findUserByName(@RequestParam String uname);
}
